<? 
include ('data.php');
$project_id = $_GET['project_id'];
if ($project_id <> NULL)  {
	$query = "select * from projects where id = ".$project_id;
$projects_result = mysql_query($query);
if ( !$projects_result )
{
	echo ( "<P>Error doing a select on projects: " . mysql_error() . "</P>" );
}
$project = mysql_fetch_array($projects_result);
$project_tag = $project['tag'];
$project_title = $project['title'];
$project_background = $project['background'];
$project_width = $project['width'];
$project_height = $project['height'];
$project_css = $project['css'];
$project_created = $project['created'];
$project_markerIcon = $project['markerIcon'];
$project_iwidth = $project['iwidth'];
$project_iheight = $project['iheight'];

echo '<p>Project Information</p><table border = "1">';
echo '<tr><th>Name</th><th>Value</th></tr>';
echo '<tr><td>Id</td><td>'.$project_id.'</td></tr>';
echo '<tr><td>Tag</td><td>'.$project_tag.'</td></tr>';
echo '<tr><td>Title</td><td>'.$project_title.'</td></tr>';
echo '<tr><td>Background</td><td>'.$project_background.'</td></tr>';
echo '<tr><td>Width</td><td>'.$project_width.'</td></tr>';
echo '<tr><td>Height</td><td>'.$project_height.'</td></tr>';
echo '<tr><td>Css</td><td>'.$project_css.'</td></tr>';
echo '<tr><td>Created</td><td>'.$project_created.'</td></tr>';
echo '<tr><td>markerIcon</td><td>'.$project_markerIcon.'</td></tr>';
echo '<tr><td>iwidth</td><td>'.$project_iwidth.'</td></tr>';
echo '<tr><td>iheight</td><td>'.$project_iheight.'</td></tr>';

echo '</table>';

// GET Markers
$query = "select * from markers where project = ".$project_id;
$markers_result = mysql_query($query);
if ( !$markers_result )
{
	echo ( "<P>Error doing a select on markers: " . mysql_error() . "</P>" );
}
echo '<p>Markers</p><table border = "1">';
echo '<tr><th>Ident</th><th>PosX</th><th>PosY</th><th>Icon</th><th>Title</th><th>Text</th><th>Link</th></tr>';
$rr=mysql_num_rows($markers_result);
for ($i=0; $i<$rr; $i++) {
$nextresult = mysql_fetch_array($markers_result);
$marker_id = $nextresult['ident'];
$marker_posx = $nextresult['posx'];
$marker_posy = $nextresult['posy'];
$marker_icon = $nextresult['icon'];
$marker_title = $nextresult['title'];
$marker_txt = $nextresult['txt'];
$marker_lnk = $nextresult['lnk'];
echo '<tr><td>'.$marker_id.'</td><td>'.$marker_posx.'</td><td>'.$marker_posy.'</td><td>'.$marker_icon.'</td>
<td>'.$marker_title.'</td><td>'.$marker_txt.'</td><td>'.$marker_lnk.'</td></td>';
	} //end for
echo '</table>';
} // top if
echo '<br/><a href="#" onClick="history.go(-1)"></a> 
<input type=button value="Back" onClick="history.go(-1)">';
?>